package defpackage; import cn.wps.show.app.KmoPresentation; import defpackage.atm; import defpackage.tvv; import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /* renamed from: uug reason: default package */ public final class uug extends bbo { private KmoPresentation uTJ; private Map<Integer, String> vML = new HashMap(); private Map<Integer, clt> vMM = new HashMap(); private List<Integer> vMN = new ArrayList(); private Map<Integer, clt> vMO = new HashMap(); private int vMP = 0; private Map<Integer, clt> vMQ = new HashMap(); private Map<String, String> vMR = new HashMap(); private clu vMS; private Map<clt, zig> vMT = new HashMap(); private Map<clt, tvv.a> vMU = new HashMap(); public uug(KmoPresentation kmoPresentation, clu clu) { this.vMS = clu; this.uTJ = kmoPresentation; } public static ckx aok(int i) { switch (i) { case 2: return ckw.chz; case 3: return ckw.chA; case 4: return ckw.chB; case 5: return ckw.chx; case 6: return ckw.chw; case 7: return ckw.chC; case 8: return ckw.chD; case 9: return ckw.chy; case 10: return ckw.chE; case 11: case 14: case 15: case 31: case 32: default: return null; case 12: return ckw.chF; case 13: return ckw.chG; case 16: return ckw.chI; case 17: return ckw.chL; case 18: return ckw.chM; case 19: return ckw.chK; case 20: return ckw.chJ; case 21: return ckw.chN; case 22: return ckw.chO; case 23: return ckw.chP; case 24: return ckw.chQ; case 25: return ckw.chR; case 26: return ckw.chV; case 27: return ckw.chU; case 28: return ckw.chW; case 29: return ckw.chS; case 30: return ckw.chT; case 33: return ckw.chY; case 34: return ckw.chZ; case 35: return ckw.cij; case 36: return ckw.cia; case 37: return ckw.cih; case 38: return ckw.cii; case 39: return ckw.cib; case 40: return ckw.cic; case 41: return ckw.cie; case 42: return ckw.cif; case 43: return ckw.cig; case 44: return ckw.cim; } } private String bZ(int i, boolean z) { ckx aok; tpu ajq = this.uTJ.uTr.ajq(i); if (ajq != null) { if (z) { switch (ajq.type) { case 16: aok = ckw.cin; break; case 17: aok = ckw.cio; break; case 18: aok = ckw.cip; break; case 19: case 20: case 21: case 22: case 23: case 24: case 25: case 26: case 27: case 28: case 29: case 30: case 31: case 32: default: aok = null; break; case 33: aok = ckw.ciq; break; case 34: aok = ckw.cir; break; case 35: aok = ckw.ciA; break; case 36: aok = ckw.cis; break; case 37: aok = ckw.ciy; break; case 38: aok = ckw.ciz; break; case 39: aok = ckw.cit; break; case 40: aok = ckw.ciu; break; case 41: aok = ckw.civ; break; case 42: aok = ckw.ciw; break; case 43: aok = ckw.cix; break; case 44: aok = ckw.ciD; break; } } else { aok = aok(ajq.type); } if (aok != null) { if (ajq.foE()) { return this.vMS.a(aok, ajq.aZg, clc.EXTERNAL).ckE; } clt a = this.vMS.a(aok, uub.lK(ajq.type, i)); String str = a.ckE; if (z) { return str; } this.vML.put(Integer.valueOf(i), str); this.vMM.put(Integer.valueOf(i), a); return str; } } return ""; } @Override // defpackage.bbo public final void a(coj coj, int i, atm atm) { String str = "embed"; tpu ajq = this.uTJ.uTr.ajq(i); if (ajq != null) { str = ajq.foE() ? "link" : "embed"; } String bZ = bZ(i, true); coj.N("p14", "media"); coj.M("p14", "http://schemas.microsoft.com/office/powerpoint/2010/main"); coj.h("r", str, bZ); if (atm.UG()) { atm.e UF = atm.UF(); if (UF.UZ() || UF.Vb()) { coj.N("p14", "fade"); if (UF.Vb()) { coj.r("in", UF.Va()); } if (UF.UZ()) { coj.r("out", UF.UY()); } coj.O("p14", "fade"); } if (UF.Vd() || UF.Vf()) { coj.N("p14", "trim"); if (UF.Vd()) { coj.r("st", UF.Vc()); } if (UF.Vf()) { coj.r("end", UF.Ve()); } coj.O("p14", "trim"); } if (UF.Vh()) { coj.N("p14", "bmkLst"); ArrayList<atm.c> arrayList = new ArrayList(); UF.Vg().c(arrayList); for (atm.c cVar : arrayList) { coj.N("p14", "bmk"); coj.J("name", cVar.name()); coj.b("time", cVar.UX()); coj.O("p14", "bmk"); } coj.O("p14", "bmkLst"); } } coj.O("p14", "media"); } @Override // defpackage.bbo public final void a(coj coj, int i, String str) { ckx ckx; int i2; String str2; int i3 = uub.vME; if ("Excel.Sheet.12".equals(str)) { ckx ckx2 = ckw.ciK; int i4 = uts.vMr; uts.vMr = i4 + 1; ckx = ckx2; i2 = i4; } else if ("Excel.SheetBinaryMacroEnabled.12".equals(str)) { ckx = ckw.ciL; i2 = i3; } else if ("Word.Document.12".equals(str)) { ckx = ckw.ciM; i2 = i3; } else if ("PowerPoint.Show.8".equals(str)) { ckx = ckw.ciH; i2 = i3; } else if ("PowerPoint.Show.12".equals(str)) { ckx = ckw.ciI; i2 = i3; } else if ("PowerPoint.Slide.12".equals(str)) { ckx = ckw.ciJ; i2 = i3; } else if ("Package".equals(str)) { ckx = ckw.ciG; i2 = i3; } else { ckx = null; i2 = i3; } if (ckx == null) { ckx = ckw.ciG; } tpu ajq = this.uTJ.uTr.ajq(i); if (ajq != null && ajq.foE()) { str2 = this.vMS.a(ckx, ajq.aZg, clc.EXTERNAL).ckE; } else if (this.vMQ.get(Integer.valueOf(i)) == null) { uub.vME++; clt a = this.vMS.a(ckx, i2); this.vMQ.put(Integer.valueOf(i), a); str2 = a.ckE; } else { str2 = this.vMQ.get(Integer.valueOf(i)).ckE; } coj.h("r", "id", str2); } @Override // defpackage.bbo public final void a(coj coj, atl atl) { tqy tqy; String str = ""; if (!"".equals(atl.Uu()) && (str = this.vMR.get(atl.Uu())) == null) { if (!atl.Uw()) { str = this.vMS.a(ckw.ciE, atl.Uu(), clc.EXTERNAL).ckE; } else if (atl.type().equals(ckw.chj.ciT)) { long parseLong = Long.parseLong(atl.Uu()); int i = 0; while (true) { if (i >= this.uTJ.fnX()) { tqy = null; break; } tqy ajl = this.uTJ.ajl(i); if (ajl.id == parseLong) { tqy = ajl; break; } i++; } str = this.vMS.a(ckw.chj, this.uTJ.j(tqy) + 1).ckE; } else { str = this.vMS.a(ckw.ciE, atl.Uu(), clc.EXTERNAL).ckE; } this.vMR.put(atl.Uu(), str); } coj.h("r", "id", str); } @Override // defpackage.bbo public final void a(coj coj, String str, int i) { coj.h("r", str, this.vML.containsKey(Integer.valueOf(i)) ? this.vML.get(Integer.valueOf(i)) : bZ(i, false)); } @Override // defpackage.bbo public final void a(coj coj, tvv.a aVar) { if (aVar != null) { clt a = this.vMS.a(ckw.ciR, uuj.fPh()); this.vMU.put(a, aVar); coj.h("r", "id", a.ckE); } } @Override // defpackage.bbo public final void e(coj coj, int i) { String str; tpu ajq = this.uTJ.uTr.ajq(i); if (ajq != null) { str = ajq.foE() ? "link" : "embed"; } else { str = "embed"; } coj.h("r", str, this.vML.containsKey(Integer.valueOf(i)) ? this.vML.get(Integer.valueOf(i)) : bZ(i, false)); } @Override // defpackage.bbo public final void f(coj coj, int i) { clu clu = this.vMS; ckx ckx = ckw.ciF; int i2 = this.vMP + 1; this.vMP = i2; clt a = clu.a(ckx, i2); this.vMO.put(Integer.valueOf(i), a); coj.h("r", "id", a.ckE); } @Override // defpackage.bbo public final void g(coj coj, int i) { zig ajj = this.uTJ.uTA.ajj(i); if (ajj != null) { clt a = this.vMS.a(ckw.ciO, i + 1); this.vMT.put(a, ajj); coj.h("r", "id", a.ckE); } } @Override // defpackage.bbo public final void kc(int i) { this.vMN.add(Integer.valueOf(i)); } @Override // defpackage.bbo public final boolean kd(int i) { return this.vMN.contains(Integer.valueOf(i)); } @Override // defpackage.bbo public final boolean ke(int i) { twl U = twl.U(this.uTJ.uTy.IR().gD(i)); if (U.fyu()) { atm fyt = U.fyt(); int i2 = -1; switch (fyt.Mv()) { case 1: i2 = fyt.UJ().US(); break; case 2: i2 = fyt.UB().US(); break; case 3: i2 = fyt.UD().US(); break; case 4: i2 = fyt.UH().US(); break; } if (fyt.Mv() == 0 || kf(i2)) { return true; } } return false; } @Override // defpackage.bbo public final boolean kf(int i) { tpu ajq; if (i == -1 || (ajq = this.uTJ.uTr.ajq(i)) == null) { return false; } if (ajq.foE()) { return true; } if (ajq.uUs != null) { return ajq.foE() || ajq.uUs.mFile.exists(); } return false; } @Override // defpackage.bbo public final void nq() throws IOException { luk luk; for (Map.Entry<Integer, clt> entry : this.vMM.entrySet()) { uub.a(this.uTJ, entry.getValue(), entry.getKey().intValue()); } for (Map.Entry<Integer, clt> entry2 : this.vMO.entrySet()) { tpk tpk = this.uTJ.uTx; int intValue = entry2.getKey().intValue(); tpj tpj = (intValue < 0 || intValue >= tpk.uUt.size()) ? null : tpk.uUt.get(intValue); if (tpj != null) { cls apL = entry2.getValue().apL(); byte[] data = tpj.uUs.getData(); OutputStream a = uul.a(apL); a.write(data); a.flush(); } } for (Map.Entry<Integer, clt> entry3 : this.vMQ.entrySet()) { tpu ajq = this.uTJ.uTr.ajq(entry3.getKey().intValue()); if (!(ajq == null || (luk = ajq.uUs) == null)) { cls apL2 = entry3.getValue().apL(); byte[] data2 = luk.getData(); OutputStream a2 = uul.a(apL2); a2.write(data2); a2.flush(); } } for (Map.Entry<clt, zig> entry4 : this.vMT.entrySet()) { new zjo(uul.a(entry4.getKey().apL()), entry4.getValue()).np(); } for (Map.Entry<clt, tvv.a> entry5 : this.vMU.entrySet()) { uuj uuj = new uuj(entry5.getValue(), entry5.getKey().apL()); col col = new col(uul.a(uuj.vMX)); col.startDocument(); col.N("p", "tagLst"); col.M("p", "http://schemas.openxmlformats.org/presentationml/2006/main"); ArrayList arrayList = new ArrayList(); uuj.uUZ.c(arrayList); int size = arrayList.size(); for (int i = 0; i < size; i++) { uuj.a(col, (tvw) arrayList.get(i)); } col.O("p", "tagLst"); col.endDocument(); } } }